package me.lovetcat.common.validate.annotation;

import me.lovetcat.common.validate.validator.MobileValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author acat on 2017-01-16 09:30
 */
@Constraint(validatedBy = MobileValidator.class)
@Target({ElementType.METHOD,ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)//将被JVM保留,所以他们能在运行时被JVM或其他使用反射机制的代码所读取和使用
public @interface Mobile {
    String message() default "请填写正确的手机号码";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
